import Router from 'koa-router';
const router = new Router({
    prefix: '/api'
});

router.get('/get',(ctx,next)=> {
    ctx.body = {
        id: 1,
        name: '石国庆',
        age: 27
    };
});

router.post('/post',(ctx,next)=> {
    ctx.body = 'post数据请求成功';
});


router.get('/static', async (ctx,next) => {
    // 发送静态文件
    await ctx.send(ctx, 'c.png', { root: 'static' })
})


router.post('/upload',(ctx,next)=> {

    //co-busboy
   console.log(ctx);
    ctx.body="jieshou";
});





export default router;